package com.ggqq.swagger.controller;

import com.ggqq.swagger.pojo.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {

    @GetMapping (value = "/hello")
    public String hello(){
        return "hello";
    }

    //只要我们的接口中，返回值中存在实体类，他就会被扫描到swagger中
    @PostMapping (value = "/user")
    public User user(){
        return new User();
    }

    @ApiOperation("hello控制类")//给方法加注释
    @GetMapping (value = "/hello2")
    public String hello2(String username){
        return "hello"+username;
    }

}
